<template>
  <div>
      我是新闻列表


      <p v-if="arr.length==0">请等待</p>
      <ul v-else>
          <li v-for="(v,i) in arr" :key="i" @click="fun(v.id)">{{v.commentTxt}}</li>
      </ul>
  </div>
</template>

<script>
import {homelink} from "@/api/homeapi.js"


export default {
    methods:{
        fun(id){
            console.log(id)
            this.$router.push({name:"List",params:{id}})
        }
    },
    data(){
        return{
            arr:[]
        }
    },
    mounted(){
        homelink("http://api.artgoer.cn:8084/artgoer/api/v1/user/324380/v3/topic/topicHomeByLabel?pageIndex=1&token=b544cd63-6d42-46fe-a96c-3cf96bae3113&topicId=62187","get").then((ok)=>{
            console.log(ok.data.data.commentList)

            this.arr=ok.data.data.commentList
        }).catch((err)=>{
            console.log(err)
        })
    }
}
</script>

<style>

</style>